package cn.iocoder.yudao.module.promotion.redpacket.pojo.dto;

import cn.iocoder.yudao.framework.business.basic.pojo.dto.SaveDTO;
import cn.iocoder.yudao.framework.validation.InEnumValue;
import cn.iocoder.yudao.module.api.promotion.redpacket.enums.RedPacketContinueModeEnum;
import cn.iocoder.yudao.module.api.promotion.redpacket.enums.RedPacketGrantSceneEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.PositiveOrZero;
import lombok.Data;

import java.time.LocalTime;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * 数据传输对象
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/06/21
 */
@Data
public class RedPacketConfigSaveDTO extends SaveDTO {

    @Schema(description = "新客红包金额，单位为分")
    @PositiveOrZero
    @NotNull(message = "新客红包金额不能为空")
    private Integer firstAmount;

    @Schema(description = "消费红包发放模式：0按固定金额发放、1按消费金额发放")
    @NotNull(message = "消费红包发放模式不能为空")
    @InEnumValue(RedPacketContinueModeEnum.class)
    private Integer continueMode;

    @Schema(description = "消费红包金额，单位为分")
    @PositiveOrZero
    @NotNull(message = "消费红包金额不能为空")
    private Integer continueAmount;

    @Schema(description = "消费场景：0全部、1扫码收款、2在线购物")
    @NotNull(message = "消费场景不能为空")
    @InEnumValue(RedPacketGrantSceneEnum.class)
    private Integer continueGrantScene;

    @Schema(description = "消费门槛金额，单位为分")
    @NotNull(message = "消费门槛金额不能为空")
    private Integer continueThresholdPrice;

    @Schema(description = "发放开始时间")
    private LocalTime continueGrantStartTime;

    @Schema(description = "发放结束时间")
    private LocalTime continueGrantEndTime;

    @Schema(description = "红包延迟生效小时数")
    @Min(0)
    @NotNull(message = "红包延迟生效小时数不能为空")
    private Integer delayEffectHours;

    @Schema(description = "红包有效天数")
    @Min(1)
    @NotNull(message = "红包有效天数不能为空")
    private Integer validationDays;

    @Schema(description = "红包功能开关(0关闭,1开启)")
    @NotNull(message = "红包功能开关不能为空")
    private Boolean featureEnable;

    @Schema(description = "规则说明")
    private String note;

}